package org.yawnage.base
{
	import org.robotlegs.mvcs.Actor;
	
	/**
	 * ...
	 * @author Berry Jordaan
	 */
	public class BaseActor extends Actor implements IDebug
	{
		private var classname		:String; //Only the Name of the class
		public var classPath		:String; //Fully qualified class path
		private var _debug			:Debug;
		/**
		 *
		 * @param	className
		 */
		public function BaseActor()
		{
			super();
			setClassDescription("org.yawnage.baseActor");
			
			_debug = new Debug();
		}
		
		/**
		 *
		 * @param	classname
		 */
		public function setClassDescription(className:String):void
		{
			classPath = className;
			var strA:Array = className.split(".");
			classname = strA[strA.lenght - 1];
		}
		
		/**
		 *
		 * @return
		 */
		public function qualifyPath():String
		{
			return classPath;
		}
		
		/**
		 *
		 * @return
		 */
		public function getClassName():String
		{
			return classname;
		}
		
		/**
		 *
		 * @return
		 */
		public function toString():String
		{
			return "[" + classPath + "]";
		}

		/* Abstract method that you need to override. */
		public function dispose():void {}
		
		/* INTERFACE org.yawnage.base.interfaces.IDebug */
		
		public function _trace(obj:*, scope:* = null, color:uint = 0x000000, level:String = "info"):void 
		{
			scope = (scope != null) ? scope : this;
			_debug._trace(obj, scope, color, level);
		}
		
		public function get localTrace():Boolean 
		{
			return _debug.localTrace;
		}
		
		public function set localTrace(value:Boolean):void 
		{
			_debug.localTrace = value;
		}

	}

}